<?php
class Job extends CI_Model {

	var $id_job = '';
	var $cd_designer = '';
	var $cd_project = '';
	var $nm_urlimage = '';
	var $vl_stars = '';
	var $fl_viwed = '';
	var $fl_winner = '';
	var $ds_job = '';
	
	function __construct()
	{
		parent::__construct();
	}
	
	function save($entry)
	{
		$this->cd_designer = $entry['designer'];
		$this->cd_project = $entry['project'];
		$this->nm_urlimage	= $entry['urlimage'];
		$this->ds_job = $entry['description'];
		$this->fl_viwed = FALSE;
		$this->fl_winner = FALSE;
	
		$this->db->insert('jobs', $this);
	}
	
	function delete($entry)
	{	
		$this->db->delete('jobs', array('id_job' => $entry['id'])); 
	}
	
	
	function update($id, $data)
	{
		$this->db->where('id_job', $id);
		$this->db->update('jobs', $data); 
	}
	
	function get_all()
	{
		$query = $this->db->get('jobs');
		return $query->result();
	}

}